﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using DeferredWaterDemo;

namespace Demo
{
    public class EngineEntity : DrawableGameComponent
    {
        public EngineEntity(Game game, List<ObjectProperty> properties)
            : base(game)
        {
            if (properties != null)
            {
                foreach (ObjectProperty p in properties)
                    OnProperty(p.Name, p.Value);
            }
        }

        virtual protected void OnProperty(string property, string value) {

        }

        virtual public Matrix Transform
        {
            get { return Matrix.Identity; }
            set {  }
        }

        virtual public Vector3 Position
        {
            get { return Vector3.Zero; }
            set { }
        }

        protected Core Engine
        {
            get
            {
                return Game as Core;
            }
        }

        virtual public void DrawLights()
        {

        }
        protected bool IsReloading
        {
            get
            {
                return _stateReloading;
            }
        }
        bool _stateReloading = false;
        public void ReloadGraphics()
        {
            _stateReloading = true;
            UnloadContent();
            LoadContent();
            _stateReloading = false;
        }
    }
}
